home *** CD-ROM | disk | FTP | other *** search
- Path: interramp.com!usenet
- From: tandemino@interramp.com (Joe Peterson)
- Newsgroups: comp.lang.c
- Subject: Re: What the heck is ...?
- Date: Mon, 12 Feb 1996 03:44:05 GMT
- Organization: Dolphin Systems, Inc.
- Message-ID: <311eb63e.1004560@usenet.interramp.com>
- References: <sconi-1102961642580001@ip-24.newportnet.net>
- NNTP-Posting-Host: ip38.birmingham.al.interramp.com
- X-Newsreader: Forte Agent .99d/32.182
-
- On Sun, 11 Feb 1996 16:42:57 -0800, sconi@superstore.com (Chris Tiee
- "Chochoni Boboni") mumbled:
-
- >Here's something all the books love to avoid: The use of ... in function
- >declarations. For example, one book says that the prototype of printf() is
- >
- >int printf(const char *fmt_string, ...);
- >
- >but nowhere in the book does it ever document the meaning or usage of ...
- >. (actually, it did document ..., but because it was also a C++ book as
- >well, it said that ... is used to catch all the exceptions in exception
- >handling). I scrambled through some other C books, but they never made any
- >explanations at all.
- >
- >Doesn't anyone know what it does? I don't like to learn things without
- >learning it completely.
-
- The elipsis indicates that the function has a variable number of
- arguments from that position on. The compiler merely pushes the
- actual parameters onto the stack. It is the responsibility of the
- called function to parse those values on the stack, using the
- 'varargs' constructs. In fact, the called function could interpret
- the values in a way different from what the calling function expects
- them to be.
-
- Pick up a copy of a good 'C' book for an explanation of how the called
- function might deal with a variable number of arguments.
- --
- Joe Peterson
- Dolphin Systems, Inc.
- West Palm Beach, Florida
-